def fib(n):
    a,b = 1, 1
    while a<n:
        print(a,end=' ')
        a,b = b, a+b
        print(a,b)

fib(1000)

def fibs(n):
    a,b = 0,1
    print(a)
    while a< n:
        a,b = b,a+b
        print(a)

fibs(1000)